set scheme s1mono

use ../Metadata/tess_analysisdata.dta, clear

drop if hyp_nodiff == 1 // no-difference hypothesis
drop if non_treatment_test == 1 // non-experiment
drop if twop >= . 

lab def dcat 1 "trivial" 2 "small" 3 "medium" 4 "large"

gen dcat=.
replace dcat=1 if d>=0 & d<0.2
replace dcat=2 if d>=.2&d<.5
replace dcat=3 if d>=.5 & d<.8
replace dcat=4 if d>=.8 & d!=.
lab val dcat dcat 
tab dcat
tab dcat if rightdir!="no"

sum dcat if hyp_true==1
twoway ///
	(histogram dcat if hyp_true==1, ///
	percent lcolor(red%60) fcolor(red%40) barw(.5)) ///
	, ///
	xlabel(1(1)4, value) title("Supported") ///
	xtitle("Cohen's d") ///
	note("N (hypotheses) = `r(N)'", size(3)) ///
	name(below05, replace)

sum dcat if hyp_true==0
twoway ///
	(histogram dcat if hyp_true==0, ///
	percent lcolor(blue%60) fcolor(blue%40) barw(.5)) ///
	, ///
	xlabel(1(1)4, value) title("Unsupported") ///
	xtitle("Cohen's d") ///
	note("N (hypotheses) = `r(N)'", size(3)) ///
	name(above05, replace)

graph combine below05 above05

